﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace DBSourceTools
{
    public partial class CodePopupForm : Form
    {
        public string SelectedText { get; set; }
        public CodePopupForm()
        {
            InitializeComponent();
        }

        private void CodePopupForm_Load(object sender, EventArgs e)
        {

        }

        private void OnKeyPress(object sender, KeyPressEventArgs e)
        {

        }

        private void OnKeyUp(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Escape)
                this.Close();
            if (e.KeyCode == Keys.Enter)
            {
                if (m_listBoxCode.SelectedItem != null)
                    this.SelectedText = m_listBoxCode.SelectedItem.ToString();
                this.Close();
            }
        }
    }
}
